import myRequest from '@/utils/myRequest'

export function getSiteSettings() {
  return myRequest({
    url: '/api/settings',
    method: 'get'
  })
}


export function setSiteSettings(kvPairs) {
  return myRequest({
    url: '/api/settings',
    method: 'post',
    data: kvPairs
  })
}

export function updateSiteInfo(markdown) {
  return myRequest({
    url: '/api/site_info/update',
    method: 'post',
    data: markdown,
    headers: {
      'Content-Type': 'text/plain'  // Ensures the raw string is sent without encoding
    }
  })
}

export function getSiteInfo() {
  return myRequest({
    url: '/api/site_info',
    method: 'get'
  })
}
